home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1992 May / 1992-05.d64 / pixel mover.demo (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  4KB  |  116 lines

  1. 10 rem copyright 1992 - compute publications intl ltd - all rights reserved
  2. 40 a=a+1:if a=1 then load"pixel mover.obj",8,1
  3. 50 sa= 51888:en= sa+125:xp= sa+87:yp= sa+92:d1= sa+375:d2= sa+372:wr= sa+599
  4. 60 sp= sa+211:tk= sa+51:b1= 53280:b2= 53281:sc= peek(648)*256
  5. 70 ef= -65536:p= 1000:s2= 51700:c= 0:ck =c:x= 782:y= 781
  6. 80 sp$="                      ":rem 22 spaces
  7. 90 rem ---- ml chrout wedge ----
  8. 100 rem (totally relocateable; set s2 to start address of wedge)
  9. 110 data 141,-16,142,-18,140,-20,165,154,201,3,240,9,169,0,162,0,160,0,76
  10. 120 data 202,241,173,-16,201,13,240,4,201,17,208,236,164,214,192,24,208,230
  11. 130 data 169,0,170,160,8,32,-1112,198,214,32,16,229,76,-15,-65536
  12. 140 rem ----
  13. 150 reada:za=abs(a):ifa=efthen220
  14. 160 ck=ck+za:ifsgn(a)=-1then180
  15. 170 pokes2+c,a:c=c+1:poke b1,a:goto150
  16. 180 ifza>1000thenzz=sa+za-1000:goto200
  17. 190 zz=s2+za
  18. 200 hi=int(zz/256):lo=zz-hi*256:pokes2+c,lo:pokes2+c+1,hi:c=c+2:goto150
  19. 210 rem ----
  20. 220 if ck<>7031then print"error in data statements!":stop
  21. 230 sys tk:sys 65418:sys sa
  22. 240 hi=int(s2/256):lo=s2-hi*256:poke 806,lo:poke 807,hi:rem set new vector
  23. 250 poke b1,0:poke b2,0:poke 648,224:print"[151][147]":poke648,sc/256
  24. 260 poke sp,0:poke yp,23:rem enter 24 row mode
  25. 270 poke d2,18:sys en,0,200:poke d2,30
  26. 280 print"[155][147]":gosub1110
  27. 290 print spc(14)"[175][175][175][175][175][175][175][175][175][175][175][175][175]"
  28. 300 print spc(14)"[152] pixel mover "
  29. 310 print spc(14)"[151][183][183][183][183][183][183][183][183][183][183][183][183][183][155]"
  30. 320 print:print "  copyright 1991 compute pubs intl ltd"
  31. 330 print:print "   welcome to pixel mover, the smooth"
  32. 340 print"scrolling program for the commodore 64!"
  33. 350 print"with pixel mover, you can smoothly"
  34. 360 print"scroll the whole screen one pixel at a"
  35. 370 print"time in all eight directions, even"
  36. 380 print"from basic![158]"
  37. 390 print:printspc(6)"press a key to continue...."
  38. 400 sys en,0,40
  39. 410 geta$:if a$="" then410
  40. 420 sys en,0,152
  41. 430 poke wr,1:poke d1,19:poke d2,19:poke xp,192:poke yp,19
  42. 440 print"[152][147]":gosub1120
  43. 450 x1=9:y1=8:gosub1170:printleft$(sp$,21);
  44. 460 print spc(19)" [153]press a number from[152] ";
  45. 470 print spc(19)" [153]1 to 8 for a       [152] ";
  46. 480 print spc(19)" [153]different scroll   [152] ";
  47. 490 print spc(19)" [153]direction. press c [152] ";
  48. 500 print spc(19)" [153]to continue....    [152] ";
  49. 510 print spc(19)left$(sp$,21);
  50. 520 geta$:ifa$="c"then580
  51. 530 if a$="" then520
  52. 540 v= val(a$):if v<1 or v>8 then520
  53. 550 if v=3 then sys en,2,320:goto440
  54. 560 if v=7 then sys en,6,320:goto440
  55. 570 sys en,v-1,200:goto440
  56. 580 print "[152][147]":gosub1110:poke yp,23:poke d2,30
  57. 590 print"    the horizontal and vertical"
  58. 600 print" scrolling speed can be changed"
  59. 610 print" for....":sys en,0,40
  60. 620 poke d1,1:poke d2,1:rem adjust delay timing value
  61. 630 print spc(11)"faster scrolling...."
  62. 640 sys en,0,88:sys en,2,320
  63. 650 poke d1,40:poke d2,40
  64. 660 print spc(8)"or slower scrolling...."
  65. 670 sys en,0,88:sys en,6,240
  66. 680 poke yp,19:poke d1,18:poke d2,18:poke wr,0:print"[152][147]";:gosub1120
  67. 690 x1=11:y1=10:gosub1170
  68. 700 print" [153]you can also have[152] ";
  69. 710 print spc(21)" [153]horizontal scroll[152] ";
  70. 720 print spc(21)" [153]wrap on....      [152] ";
  71. 730 sys en,2,320
  72. 740 x1=11:y1=14:gosub1170:print" [158]  hit a key.... [152]  "
  73. 750 get a$:if a$="" then750
  74. 760 x1=19:y1=13:gosub1170:print"[153] or off."
  75. 770 x1=11:y1=14:gosub1170:print"[152][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219]"
  76. 780 poke wr,1:sys en,6,320
  77. 790 poke sp,1:rem set to 8 pixel scrolling
  78. 800 poke d1,30:poke d2,30
  79. 810 print"[152][147]":gosub1120
  80. 820 x1=9:y1=9:gosub1170
  81. 830 print" [153]you can scroll eight[152] ";
  82. 840 printspc(18)" [153]pixels at a time... [152] ";
  83. 850 printspc(18)" [153]enter a number      [152] ";
  84. 860 printspc(18)" [153]between 1 and 8.    [152] ";
  85. 870 printspc(18)" [153]press c to continue.[152] "
  86. 880 get a$:if a$="c"then930
  87. 890 v=val(a$):if v<1 or v>8 then880
  88. 900 if v=3 then sys en,2,40:goto810
  89. 910 if v=7 then sys en,6,40:goto810
  90. 920 sys en,v-1,25:goto810
  91. 930 poke yp,23:poke sp,0:poke d1,18:poke d2,18:poke xp,200
  92. 940 print"[152][147]":gosub1110:poke d2,30
  93. 950 print"     pixel mover supports these"
  94. 960 print"  features for optimal compatibility"
  95. 970 print"  and flexibility:":print
  96. 980 print"  [151]*[155] you can change the screen memory"
  97. 990 print"    or the video bank and pixel mover"
  98. 1000 print"    will adapt to these changes."
  99. 1010 print:print"  [151]*[155] the [150]pixel mover relocator[155] will"
  100. 1020 print"    relocate a copy of pixel mover to"
  101. 1030 print"    any location in memory."
  102. 1040 print:printspc(5)"[153]hit [158] space [146][153] to restart this"
  103. 1050 printspc(3)"demo. hit any other key to quit."
  104. 1060 sys en,0,40
  105. 1070 get a$:if a$="" then1070
  106. 1080 if a$=" " then230
  107. 1090 poke yp,24:sys tk:sys 65418:sys 65409:end
  108. 1100 rem ----
  109. 1110 x1=0:y1=24:gosub1170:return:rem plot cursor to bottom of screen
  110. 1120 poke yp,peek(yp)and239
  111. 1130 print"[176][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][178][174]";
  112. 1140 fori=1 to 23:print"[171][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][219][179]";:next
  113. 1150 zz=sc+960:poke zz,109:for i=zz+1 to zz+38:poke i,113:next:poke zz+39,125
  114. 1160 print"";:poke yp,peek(yp)or16:return
  115. 1170 pokex,x1:pokey,y1:sys58636:return
  116.